//
//  WSChapterVideoCell.m
//  CharonTVProject
//
//  Created by karong on 2023/8/8.
//

#import "WSChapterVideoCell.h"
#import "UIView+WSDraw.h"

@interface WSChapterVideoCell ()
@property (weak, nonatomic) IBOutlet UIView *mainView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIButton *lockBtn;
@property (weak, nonatomic) IBOutlet UIButton *vipBtn;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@end

@implementation WSChapterVideoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self.vipBtn setupRoundedCornersWithCutCorners:~UIRectCornerTopRight withRadii:CGSizeMake(5, 5)];
}

- (void)setDataWithObject:(WSVideo *)object {
    self.titleLabel.text = WSSF(@"第%ld集", object.sort);
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:object.cover]];
    self.mainView.layer.borderColor = object.isSelected?UIColor.font_yellow_FCB625.CGColor:UIColor.clearColor.CGColor;
    self.mainView.layer.borderWidth = object.isSelected?1:0;
    self.vipBtn.hidden = !object.is_vip;
    self.lockBtn.hidden = !object.needPay;
}

@end
